namespace Crux.Core.MethodEx;
/// <summary>
/// PropertyInfoCache
/// </summary>
public class PropertyInfoCache
{
    /// <summary>
    ///
    /// </summary>
    private readonly ConcurrentDictionary<Type, PropertyInfo?> _state =
      new();
    /// <summary>
    ///
    /// </summary>
    /// <param name="type"></param>
    /// <param name="name"></param>
    /// <returns></returns>
    public PropertyInfo? FromCache(Type type, string name)
        => _state.GetOrAdd(type, t => t.GetProperty(name));
}